var k = "E";
cc = new Array('#FE007B', '#F1041F', '#146634', '#FE5D0D', '#000B7A', '#0067FC', '#6F6D6C', '#E2AC27',
			   '#812F9C', '#FFFFFF', '#000000', '#58AAEF', '#007586', '#43CA16', '#0124C9', '#8DE99A',
			   '#8D4D0A', '#AB0149', '#F898E9', '#F8E59E', '#0E8F5A', '#FFFC1A', '#C1C1C1', '#970DE8');
cd = "AAAAAAAAAAAAAAAAAAAAAAAA";
function l(u){k = u;m();} 
function g(v) {if (document.images) {if(k>='A' && k<='Z'){cd=as(cd,v-1,k);}u="http://www.bracesmile.pt/bracecolors/cores/?img=" + v + "&clr=" + k;n(u);document["l"+v].src=u;}sh();}
function m() {if(k=='J' || k=='P' || k=='T' || k=='V') ct='#000000'; else ct='#FFFFFF'; document.getElementById('cs').style.color = ct; 
	if(k>='A' && k<='Z'){color=cc[k.charCodeAt() - 65];}else{color=cc[0];}document.getElementById('cs').style.backgroundColor = color;}	
function n(o){if (document.images){ni = new Image();ni.src = o;return ni;}} 	
function as(s,i,c) {if(i>s.length-1) return s;return s.substr(0,i) + c + s.substr(i+1);}
function sh(){document.getElementById("text").value="<A href=\"http://www.bracesmile.pt/cor-do-aparelho-ortodontico/\"> <IMG src=\"http://www.bracesmile.pt/bracecolors/?bracecolors=" + cd + "\" alt=\"cor aparelho ortodontico\" /> </A>";
document.getElementById("text").select();}
function dn(){window.location="http://www.bracesmile.pt/bracecolors/?bracecolors="+cd;}
